<?php
/**
 * Created by PhpStorm.
 * User: Hong
 * Date: 2018/4/2
 * Time: 10:05
 * Function:
 */

namespace Organize\Controllers\System;

use Illuminate\Http\Request;
use Organize\Controllers\BaseOrganizeController;
use Organize\Resources\OrganizeLogResources;
use Platform\Models\Organize\LeaderOperationLog;
use Platform\Repository\Organize\LogRepository;

/**
 * @module 操作日志
 * Class LogController
 * @package Admin\Controllers\System
 */
class LogController extends BaseOrganizeController
{
    protected $repository;
    public function __construct(LogRepository $repository)
    {
        parent::__construct();
        $this->repository = $repository;
    }

    /**
     * @permission 日志列表
     * @param Request $request
     * @return mixed
     */
    public function index(Request $request)
    {
        $logs = $this->repository->screen($request,$this->organize)->orderBy('id', 'desc')->paginate(10);

        return myResult()->setData($logs,OrganizeLogResources::class)->setPage($logs)->send();
    }
}